package io;

import java.io.*;

/**
 * @description: 标准输入和输出
 * @author apple
 * @date 2021/9/14 12:56 下午
 * @version 1.0
 */
public class StandardDemo {

    public static void main(String[] args) throws IOException {

        // 获取标准输入流
        InputStream in = System.in;
        // 获取标准输出流
        PrintStream out = System.out;
        // 输入流字符转换器
        InputStreamReader inputStreamReader = new InputStreamReader(in);
        // 输入流字符转换器
        OutputStreamWriter outputStreamWriter = new OutputStreamWriter(out);
        // 缓冲输入字符流
        BufferedReader r = new BufferedReader(inputStreamReader);
        // 缓冲输出字符流
        BufferedWriter w = new BufferedWriter(outputStreamWriter);

        String str = "";
        while (!str.equals("exit")) {
            str = r.readLine(); // 读取一行
            w.write(str); // 输出
            w.flush();
        }
        inputStreamReader.close();
        outputStreamWriter.close();
        r.close();
        w.close();



    }
}
